home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
M-More Monthly Disks
/
(c)m3.d64
/
discat.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
8KB
|
244 lines
0 REM GOTO 0 TO REENTER WITHOUT RELOAD
5 S$=" "+""
6 SB=53280:SC=53281:PRINT"[144]"
10 IFPEEK(50326)=198THEN6075
15 GOTO6000
20 REM#################################
21 REM# JIM SMITH #
22 REM# 111 EMILY STREET #
23 REM# ORILLIA L3V 5V2 #
24 REM# 325-6227 #
25 REM#GREAT WHITE NORTH COMPUTER CLUB#
26 REM# DISCAT-A 1541 DISK UTILITY TO #
27 REM#FORM A LIBRARY OF PROGRAM NAMES#
32 REM#################################
79 REM******SCREEN FORMAT************
80 POKESB,CB:POKESC,CS:PRINT"[147][213][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195]DISCAT[195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][201]";
81 PRINT"[194] [194]";
82 PRINT"[202][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][203]";HL$;:RETURN
99 REM***MAKE A SCREEN HEADER*********
100 CB=15:CS=12
105 HL$=" C[146]ATLG D[146]SPLAY E[146]XIT H[146]ELP P[146]RNT $[146]DIR S[146]RCH"
120 GOSUB80:PRINTHL$:PRINT" COMMAND?":RETURN
199 REM****CATALOG SELECTED***********
200 CB=15:CS=12
205 HL$=" CATALOG FUNCTION ":GOSUB80
210 PRINT" CATALOG? (Y/N)"
212 GETY$:IFY$=""THEN212
213 IFY$<>"Y"THENRETURN
219 REM** FORM ID AND BLOCKS FREE **
220 PRINT" INSERT DISK FOR CATALOG AND HIT A KEY."
230 GETA$:IFA$=""THEN230
240 OPEN2,8,2,"#":GOSUB300:PRINT#15,"U1";2;0;18;0:PRINT#15,"B-P:"2;162
250 GET#2,I$,D$:ID$=I$+D$:CLOSE2:OPEN1,8,0,"$0:%%2^!"
255 CH$=" "+"":SYS50323
260 DH$=" "+"":SYS50323
262 H$=LEFT$(CH$,16)+ID$+STR$(PEEK(251)+256*PEEK(252)):CLOSE1
265 PRINT" CURRENT DISK: "H$:PRINT" SEARCHING ";NH;" HEADERS FOR MATCH"
270 FORCT=1TONH:IFH$=HF$(CT)THEN290
274 NEXT:FORCT=1TONH
275 IFID$=MID$(HF$(CT),17,2)THENPRINT" ID MATCH FOUND":GOTO297
277 REM******APPEND NEW HEADER*********
278 NEXT:NH=NH+1:HF$(NH)=H$:HF$(0)=STR$(NH):GOSUB600
287 PRINT" SORTING FILES":SYS49152,NH,HF$(1):SYS49152,NF,MF$(1):RETURN
289 REM** CURRENT HEADER IS IDENTICAL MATCH **
290 PRINT" DISK ID AND BLOCKS-FREE COUNT INDICATE";
291 PRINT" THAT THIS DISK HAS NOT CHANGED SINCE "
292 PRINT" IT WAS LOGGED."
294 PRINT" DO YOU WANT IT LOGGED AGAIN? <Y/N>"
295 GETA$:IFA$=""THEN295
296 IFA$<>"Y"THENRETURN
297 HF$(CT)=H$:GOSUB500:GOSUB600:PRINT" SORTING":SYS49152,NF,MF$(1):RETURN
299 REM****ERROR TRAPPING ROUTINES*****
300 INPUT#15,E,G$,L$,K$:IFE<20THENRETURN
310 IFE=74THENPRINT" DISK NOT PRESENT":STOP:RETURN
320 PRINTE;G$;L$;K$:CLOSE15:END
399 REM******APPEND HEADER***********
400 NH=NH+1:HF$(NH)=H$:HF$(0)=STR$(NH):RETURN
499 REM*******DELETE FILES**********
500 PRINT" DELETING OLD FILE NAMES"
502 TC=NF:FORCT=1TONF:IFMID$(MF$(CT),19,2)=ID$THENMF$(CT)="[255][255][255]"+MF$(CT):TC=TC-1
505 NEXT
510 SYS49152,NF,MF$(1):NF=TC:MF$(0)=STR$(NF):RETURN
599 REM*******APPEND FILES**********
600 PRINT" ADDING FILE NAMES TO LIBRARY"
602 OPEN1,8,0,"$0":GOSUB300
610 DH$=" "+"":SYS50323:IFSTTHENCLOSE1:RETURN
620 FORCT=NF+1TONF+150
630 F$=" "+"":SYS50323
635 IFSTTHENMF$(0)=STR$(CT-2):NF=CT-2:CLOSE1:RETURN
640 MF$(CT)=F$+" "+ID$+STR$(PEEK(251)+256*PEEK(252)):NEXT:PRINT"APPEND ERROR:END
699 [143]*******$DIRECTORY****************
700 CB[178]15:CS[178]12:HL$[178]"INSERT DISK AND HIT KEY-SPACE PAUSES":[141]80
701 [161]A$:[139]A$[178]""[167]701
702 [158]50178:[153]"HIT A KEY FOR MENU"
705 [161]A$:[139]A$[178]""[167]705
710 [142]
999 [143]******DISPLAY SELECTED*********
1000 CB[178]3:CS[178]13
1005 HL$[178]"DISPLAY-SPACE BAR TO PAUSE-F1 TO ABORT":[141]80
1010 [153]" FWAITILE OR HWAITEADERS?":[153]""
1020 [161]A$:[139]A$[178]""[167]1020
1030 [139]A$[178]"F"[167]1060
1040 [139]A$[178]"H"[167]1080
1050 [137]1010
1059 [143]******FILE DISPLAY************
1060 [129]I[178]1[164]NF:[161]A$:[139]A$[178]"INPUT"[167][142]
1061 [139][194](197)[179][177]64[167]1061
1062 [153][163]6)MF$(I):[130]
1063 [153]" FINISHED -HIT F1WAIT KEY FOR MENU "
1065 [161]A$:[139]A$[178]""[167]1065
1066 [139]A$[179][177]"INPUT"[167]1065
1068 [142]
1079 [143]*******HEADER DISPLAY**********
1080 [129]J[178]1[164][181](NH[171]1)[173]15[170]1
1083 HL$[178]"HEADERS-F1WAIT FOR MENU/SPACE BAR TO GO ON":[141]80
1084 [153]""
1085 [129]I[178]J[172]15[171]14[164]J[172]15:[153][163]8)HF$(I):[130]
1095 [161]A$:[139]A$[178]"INPUT"[167][142]
1100 [139]A$[178]" "[167]1120
1105 [137]1095
1120 [130]:[137]1080
1999 [143]*******PRINT SELECTED**********
2000 CB[178]11:CS[178]12
2005 HL$[178]" PRINT SELECTED":[141]80:[153]HL$
2010 [153]" PRINT? <Y/N> "
2015 [161]A$:[139]A$[178]""[167]2015
2020 [139]A$[179][177]"Y"[167][142]
2025 [153]"FWAITILES OR HWAITEADERS OR BWAITOTH ?"
2030 [161]A$:[139]A$[178]""[167]2030
2035 [139]A$[178]"F"[167]2065
2036 [139]A$[178]"B"[167]2300
2040 [139]A$[179][177]"H"[167][142]
2041 [159]4,4:[152]4,[199](27);[199](64);
2045 [152]4,[199](142);" ";NH;" HEADERS";[199](15)
2048 [152]4:[152]4:[152]4,[199](27);[199](68);[199](35);[199](70);[199](0);
2050 [129]CT[178]1[164]NH[169]2:[152]4,[199](9);HF$(CT);[199](9);HF$(CT[170]1):[130]:[137]2080
2065 [159]4,4:[152]4,[199](27);[199](64);[199](14);" ";NF;" PROGRAMS"
2066 [152]4:[152]4
2068 [152]4,[199](27);"D";[199](5);[199](42);[199](80);[199](118);[199](0);
2070 [152]4,[199](143);:[129]CT[178]1[164]NF[169]4:[129]T[178]CT[164]CT[170]3
2071 [152]4,[199](9);MF$(T);:[130]:[152]4,[199](13);:[130]
2080 [152]4:[160]4:[142]
2300 [143] INITIALISE PRINTER AND SET 4COULMN TABS
2310 [159]4,4:[152]4,;[199](27);[199](64);
2315 [152]4,;[199](27);[199](68);[199](5);[199](42);[199](80);[199](118);[199](0);
2330 [129]J[178]1[164]NH:[152]4,HF$(J);[199](143);[199](13);
2340 ID$[178][202](HF$(J),17,2):CT[178]3
2350 [129]I[178]1[164]NF:[139]ID$[179][177][202](MF$(I),19,2)[167]2380
2360 CT[178]CT[170]1:[139]CT[178]4[167][152]4,[199](13);:CT[178]0
2370 [152]4,;[199](9);MF$(I);
2380 [130]:[152]4,[199](146);[199](13):[130]:[137]2080
2999 [143]******SEARCH SELECTED**********
3000 CB[178]8:CS[178]9
3002 HL$[178]" SEARCH (AND SCRATCH) FILES":[141]80
3004 [153]" SEARCH? (Y/N)"
3006 [161]Y$:[139]Y$[178]""[167]3006
3008 [139]Y$[179][177]"Y"[167][142]
3010 N$[178]"":[133]" SEARCH FOR";N$
3012 HL$[178]"LOOKING UP: "[170]N$:[141]80:[153]""
3014 FL[178]0:NS[178]0:LN[178][195](N$):[129]CT[178]1[164]NF
3016 [139]N$[178][200](MF$(CT),LN)[167][153][163]9)CT;MF$(CT):FL[178]1:NS[178]NS[170]1
3018 [139]NS[179][177]18[167]3030
3020 NS[178]0:[153]" F1WAIT TO MENU-SPACE BAR TO CONTINUE"
3022 [161]A$:[139]A$[178]""[167]3022
3024 [139]A$[178]"INPUT"[167][142]
3026 [139]A$[179][177]" "[167]3022
3028 [141]80:[153]HL$:[153]""
3030 [130]:[139]FL[178]0[167][153]" NO HITS"
3031 [153]" FINISHED-";
3032 [153]"F1WAIT TO MENU"
3033 [153]" SPACE TO SEARCH"
3034 [153]" F7WAIT TO SCRATCH FILES"
3036 [161]A$:[139]A$[178]""[167]3036
3038 [139]A$[178]"INPUT"[167][142]
3040 [139]A$[178]" "[167][153]"LOAD":[137]3010
3042 [139]A$[178]"LET"[167]3044
3043 [137]3036
3044 HL$[178]"SCRATCH SELECTED":[141]80
3046 [153]" SCRATCH? (Y/N)
3048 GETY$:IFY$=""THEN3048
3050 IFY$<>"Y"THENRETURN
3052 INPUT" NUMBER OF FILE TO SCRATCH";SN$
3054 SN=VAL(SN$):IFSN=0ORSN>NFTHENPRINT" INVALID ENTRY":GOTO3052
3056 HL$="TARGET FILE: "+MF$(SN):GOSUB80:PRINTHL$
3057 PRINT" SCRATCH THIS? (Y/N)"
3058 GETY$:IFY$=""THEN3058
3060 IFY$<>"Y"THENPRINT"":GOTO3032
3062 PRINT" INSERT DISK OF ID: ";MID$(MF$(SN),19,2);" AND HIT A KEY"
3063 GETA$:IFA$=""THEN3063
3064 FORCT=16TO1STEP-1:IFMID$(MF$(SN),CT,1)<>" "THEN3066
3065 NEXT:PRINT" SCRATCHING FILE"
3066 PRINT#15,"S0:"+LEFT$(MF$(SN),CT)
3068 INPUT#15,E$,D$,G$,H$:PRINTE$;D$;G$;H$
3070 PRINT" ANOTHER? (Y/N)"
3072 GETY$:IFY$=""THEN3072
3074 IFY$<>"Y"THENRETURN
3076 GOTO3044
3999 REM*****SAVE &/OR END***********
4000 CB=10:CS=2
4002 HL$=" SAVE AND/OR END ":GOSUB80
4003 PRINT"SAVE?-<Y/N> "
4005 GETY$:IFY$=""THEN4005
4010 IFY$="Y"THEN4060
4020 PRINT"END?-<Y/N>"
4030 GETY$:IFY$=""THEN4030
4040 IFY$="Y"THENCLOSE1:CLOSE2:CLOSE3:CLOSE4:CLOSE15:END
4050 RETURN
4060 PRINT" INSERT DISCAT[146] DISK AND HIT A KEY"
4062 GETA$:IFA$=""THEN4062
4068 PRINT"SAVING ";HF$(0);" HEADERS..."
4070 OPEN2,8,2,"@0:HDRLIST.D,S,W":GOSUB300
4080 FORCT=0TONH:PRINT#2,HF$(CT);CHR$(13);:NEXT:CLOSE2
4090 PRINT"SAVING ";MF$(0);" PROGRAM NAMES..."
4091 OPEN3,8,3,"@0:PRGLIST.D,S,W":GOSUB300
4093 FORCT=0TONF:PRINT#3,MF$(CT);CHR$(13);:NEXT:CLOSE3:GOTO4020
5999 REM ******INITIALIZATION*********
6000 CB=15:CS=15
6050 HL$=" DISCAT[146] BY JIM SMITH":GOSUB80
6060 PRINT" WAIT...LOADING CODE"
6070 LOAD"DCATMLP.D",8,1
6075 IFNF<>0THEN6175
6080 DIMMF$(1000):DIMHF$(60)
6081 OPEN15,8,15:OPEN1,8,2,"HDRLIST.D,S,R":GOSUB300
6083 SYS50470:L=PEEK(142):HF$(0)=LEFT$(S$,L):NH=VAL(HF$(0))
6085 IFNH=0THENCLOSE1:C$="C":GOTO6210
6090 PRINT"...LOADING ";HF$(0);" HEADER NAMES"
6120 FORCT=1TONH:SYS50470:L=PEEK(142):HF$(CT)=LEFT$(S$,L):NEXT
6130 CLOSE1:OPEN1,8,3,"PRGLIST.D,S,R":GOSUB300
6133 SYS50470:L=PEEK(142):MF$(0)=LEFT$(S$,L):NF=VAL(MF$(0))
6140 PRINT"...LOADING ";MF$(0);" PROGRAM NAMES"
6150 FORCT=1TONF
6160 FORCT=1TONF:SYS50470:L=PEEK(142):MF$(CT)=LEFT$(S$,L):NEXT
6170 CLOSE1
6175 CB=15:CS=12
6180 HL$=" C[146]ATALOG D[146]ISPLAY E[146]XIT H[146]ELP P[146]RINT $[146]DIR":GOSUB80
6190 PRINT"[144] COMMAND?"
6200 GETC$:IFC$=""THEN6200
6210 IFC$="C"THENGOSUB200:GOSUB100
6220 IFC$="H"THENGOSUB7000:GOSUB100
6230 IFC$="D"THENGOSUB1000:GOSUB100
6240 IFC$="P"THENGOSUB2000:GOSUB100
6250 IFC$="$"THENPRINT"[147]":GOSUB700:GOSUB100
6255 IFC$="S"THENGOSUB3000:GOSUB100
6260 IFC$="E"THENGOSUB4000:GOSUB100
6270 GOTO6200
6999 REM** HELP SELECTED **
7000 POKESB,3:POKESC,13
7002 PRINT"[147]C[146]ATALOG-ADDS,REMOVES,SORTS PRG AND"
7005 PRINT" DISK NAMES TO LIBRARY."
7010 PRINT"D[146]ISPLAY-VIEW DISKNAMES OR FILE NAMES"
7015 PRINT" IN LIBRARY."
7030 PRINT"S[146]EARCH-LOOK UP A FILE-DISPLAYS FULL"
7035 PRINT" OR PARTIAL MATCH. YOU MAY";
7038 PRINT" SCRATCH BY LIBRARY NUMBER."
7040 PRINT"$[146]DIR-CURRENT DISK DIRECTORY DISPLAYED";
7045 PRINT" SPACE BAR TO PAUSE."
7048 PRINT"P[146]RINT-SET FOR M/T SPIRIT & EPSON PRINTERS";
7050 PRINT" FORMAT LINES ARE 2000-2999"
7063 PRINT" HIT A KEY FOR MENU "
7065 GETA$:IFA$=""THEN7065
7080 RETURN
8000 REM LOAD AND RUN ZERODEMFILES TO SET UP SEQ FILES BEFORE USING THIS
8005 REM PROGRAM FOR THE FIRST TIME